<cfset structAppend(variables,caller,false)/>
<cfparam name="nospan" default="false"/>

<cfset excludes = parent.excludes & ",list,optionList,valueList,array,valueArray,optionArray,checkedValue,checkValue,value,option,query,table,delimiters,valueDelimiters,sort,order,result,columnList,size,header,valueHeader,optionHeader,width,height,multiple"/>

<!--- Process NAME attribute --->
<cfif not structKeyExists(attributes,'name')>
	<cfif structKeyExists(attributes, 'id')>
		<cfparam name="config.checkValue" default="#parent.setValue('id','name',attributes)#"/>
	<cfelseif structKeyExists(config, 'forLabel')>
		<cfparam name="config.checkValue" default="#parent.setValue('forLabel','name',attributes)#"/>
	<cfelseif structKeyExists(config, 'table')>
		<cfparam name="config.checkValue" default="#parent.setValue('table','name',attributes)#"/>
	<cfelseif structKeyExists(config,'checkValue')>
		<cfset config.checkValue = parent.setValue('checkValue','name',config,attributes)/>
	<cfelseif isDefined("request.ui.form.#tag#.html") and structKeyExists(request.ui.form[tag].html,'name')>
		<cfset attributes.name = request.ui.form[tag].html.name/>
	</cfif>
	<cfif not structKeyExists(attributes, 'name')>
		<cfset parent.showException(tag,'You must specify at least one attribute of NAME, ID, or FORLABEL.',3,attributeCombination)/>
	</cfif>
</cfif>
<cfparam name="config.checkValue" default="#parent.setValue('name','',attributes)#"/>

<!--- *** CONFIG VARIABLES *** --->
<cfset structAppend(config,parent.getConfig(tag,attributes,request,parent),false)/>

<!--- *** HTML VARIABLES *** --->
<cfset attributes = parent.getHtml(tag,attributes,request)/>

<!--- Make sure we have all the required attributes --->
<cfif structKeyExists(config,'query') and (not structKeyExists(config,'value') and not structKeyExists(config,'option')) >
	<cfset parent.showException(tag,'Either VALUE or OPTION attribute must be specified to use with QUERY attribute.',3,attributeCombination)/>	
<cfelseif structKeyExists(config,'table')>
	<cfif not structKeyExists(config,'dsn')>
		<cfset parent.showException(tag,'DSN attribute must be specified to use with TABLE attribute. You can also specify with REQUEST.UI.FORM.ALL.CONFIG.DSN',3,attributeCombination)/>			
	<cfelseif not structKeyExists(config,'value') and not structKeyExists(config,'option')>
		<cfset parent.showException(tag,'Either VALUE or OPTION attribute must be specified to use with TABLE attribute.',3,attributeCombination)/>			
	</cfif>
</cfif>

<cfparam name="attributes.id" default="#attributes.name#"/>
<cfparam name="config.forLabel" default="#attributes.id#"/>
<cfif not structKeyExists(config,'label')>
			<cfset config.label = trim(replaceList(attributes.name,'j_,_,nm,psswd,id,cd,txt',' , ,Name,Password,,,'))/>
</cfif>
<cfif config.css>
	<cfset parent.config.cssLabelCode = true/>
	<cfparam name="config.classLabel" default="label"/>
</cfif>